package com.crc.luojian.util;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * @program: luojian-springframework
 * @description:
 * @author: luojian58
 * @create: 2021-06-10 13:44
 */
public class BeanUtils {
    public static <T> T instantiateClass(Constructor<T> ctor, Object... args) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        ctor.setAccessible(true);  // 设置访问权限
        return ctor.newInstance(); // 通过构造器 创建对象
    }
    /**
     * @Author luojian
     * @Description 首字母小写
     * @Date  2021/6/10 14:29
     * @Param [simpleName]
     * @return java.lang.String
     **/
    public static String lowerFirst(String simpleName) {
        char[] chars = simpleName.toCharArray();
        chars[0] += 32;
        return String.valueOf(chars);
    }
}
